import 'package:flutter/material.dart';

class BasicDemo extends StatelessWidget {
  final String title = '标题';
  final String author = 'yca';
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return ContainerDemo();
  }
}

class ContainerDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      // color: Colors.grey[100],
      decoration: BoxDecoration(
          image: DecorationImage(
              image: NetworkImage(
                  'https://p.ssl.qhimg.com/dmfd/400_300_/t0120b2f23b554b8402.jpg'),
              fit: BoxFit.cover,
              alignment: Alignment.topCenter,
              repeat: ImageRepeat.repeat,
              colorFilter: ColorFilter.mode(
                  Colors.indigoAccent[400].withOpacity(0.5),
                  BlendMode.srcATop))),

      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            child: Icon(Icons.pool, size: 32, color: Colors.white),
            padding: EdgeInsets.all(16),
            margin: EdgeInsets.all(8),
            width: 90,
            height: 90,
            decoration: BoxDecoration(
                color: Colors.orange,
                border: Border.all(
                    color: Colors.redAccent,
                    width: 2,
                    style: BorderStyle.solid),
                // borderRadius: BorderRadius.all(Radius.circular(5)),
                boxShadow: [
                  BoxShadow(
                      offset: Offset(0.0, 17.0),
                      color: Colors.orange[500],
                      blurRadius: 20,
                      spreadRadius: -10.0),
                  // BoxShadow(offset: Offset(6.0, 7.0), color: Colors.orange[500])
                ],
                shape: BoxShape.circle),
          )
        ],
      ),
    );
  }
}

class RichDemo extends StatelessWidget {
  final String title = '标题';
  final String author = 'yca';
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return RichText(
      text: TextSpan(
          text: '$author',
          style: TextStyle(
              fontSize: 33,
              color: Colors.deepOrange,
              fontStyle: FontStyle.italic),
          children: [
            TextSpan(
                text: '$title',
                style: TextStyle(fontSize: 20, color: Colors.deepPurple))
          ]),
    );
  }
}
